<?php

/**
 * Reclamo form base class.
 *
 * @method Reclamo getObject() Returns the current form's model object
 *
 * @package    aeropostal
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseReclamoForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'numero'        => new sfWidgetFormInputHidden(),
      'fecha'         => new sfWidgetFormDate(),
      'numeroFactura' => new sfWidgetFormPropelChoice(array('model' => 'Factura', 'add_empty' => false)),
      'descripcion'   => new sfWidgetFormInputText(),
      'estatus'       => new sfWidgetFormInputText(),
      'numAprob'      => new sfWidgetFormInputText(),
      'fechaAprob'    => new sfWidgetFormDate(),
      'numNota'       => new sfWidgetFormInputText(),
      'fechaNota'     => new sfWidgetFormDate(),
      'tipoNota'      => new sfWidgetFormInputText(),
      'montoNota'     => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'numero'        => new sfValidatorChoice(array('choices' => array($this->getObject()->getNumero()), 'empty_value' => $this->getObject()->getNumero(), 'required' => false)),
      'fecha'         => new sfValidatorDate(),
      'numeroFactura' => new sfValidatorPropelChoice(array('model' => 'Factura', 'column' => 'numero')),
      'descripcion'   => new sfValidatorString(array('max_length' => 500)),
      'estatus'       => new sfValidatorString(array('max_length' => 255)),
      'numAprob'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'fechaAprob'    => new sfValidatorDate(array('required' => false)),
      'numNota'       => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'fechaNota'     => new sfValidatorDate(array('required' => false)),
      'tipoNota'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'montoNota'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('reclamo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Reclamo';
  }


}
